/**
  * Author: Mei
  * Date: 2020-11-21 9:07
  * Description: 
  *
  */
#include <iostream>
#include <cstring>
#include <vector>

using namespace std;

int main() {
    vector<int> vectorOne(10);
    vector<int> aa(5, 100);
    vectorOne.swap(aa);
    for (auto a : vectorOne) {
        a /= 10;  //可以访问和修改所迭代的元素
        cout << a << " ";
    }
    cout << endl;
    vectorOne.assign({1, 2, 3, 4});
    for (auto a : vectorOne) {
        cout << a << " ";
    }
    vector<string> stringVector(10, "hello");
    for (auto &str : stringVector) {
        str.append(" there");
    }
    for (auto str : stringVector) {
        //cout << str;
    }
    cout << endl;

    //cbegin()返回的是const类型 不允许进行修改
    for(auto &iter = stringVector.cbegin(); iter != stringVector.cend(); ++iter) {
        cout << *iter;
    }
    return 0;
}